02. Building Out a Subclass

Building Out a Subclass

Question:

Start Quiz:

var Car = function(loc){
    this.loc = loc;
};
Car.prototype.move = function(){
    this.loc++;
};

var Van = function(loc){
    
}

var zed = new Car(3);
zed.move();

var amy = new Van(9);
amy.move();
//todo

User's Answer:

(Note: The answer done by the user is not guaranteed to be correct)

var Car = function(loc){
    this.loc = loc;
};
Car.prototype.move = function(){
    this.loc++;
};

var Van = function(loc){
    return Car(loc);
}

var zed = new Car(3);
zed.move();

var amy = new Van(9);
amy.move();
//todo